package org.tankwar.model;

import org.tankwar.util.GlobalUtil;
import org.tankwar.util.ImageUtil;
import org.tankwar.view.GamePanel;

import java.awt.*;

public class BrickWall extends StaticGameComponent{
    public BrickWall(int x, int y, GamePanel tc) { // 构造函数
        // 设置砖墙的宽和高
        this.width = 21;
        this.height = 21;
        // 读取图片
        componentImage = GlobalUtil.tk.getImage(this.getClass().getResource(ImageUtil.COMMON_WALL_IMAGE_URL));
        this.x = x;
        this.y = y;
        this.gamePanel = tc; // 获得界面控制
    }

    @Override
    public void draw(Graphics g) {
        g.drawImage(componentImage, x, y, null); // 在对应X，Y出画砖墙
    }
}
